Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Introduce excludes for custom exclusion on top of existing validator #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mondwan
Copy link
Contributor

@mondwan mondwan commented Nov 24, 2016

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 36a7dda on mondwan:master into d7f6baa on ansman:master.

@mondwan
Copy link
Contributor Author

mondwan commented Nov 24, 2016

refs #99
As consensus of what should be defined as isDefined are hard, I have introduce excludes for adding custom exclusion logic on top of 3 validators: format, inclusion and numericality. (For proof of concept and suite my production requirement)

It does not break existing implementation (isDefined) but allows users to exclude certain value before running a desired validator

Currently, excludes requires an array of function or constraint (I name them as hooks) and will be passed to shouldValueBeExcluded for verification. It will skip the validator if either hook return true.

@ansman ansman force-pushed the master branch 4 times, most recently from feffe94 to 40e06a1 Compare June 15, 2019 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants